package com.mf.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.mf.entity.dto.DtoIncomingDetail;
import com.mf.entity.req.search.SearchReqIncomingDetail;
import com.mf.result.Result;
import com.mf.service.ServiceIncomingDetail;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 *
 */
@RestController
@RequestMapping("incomingdetail")
@Tag(name = "来料明细")
public class ControllerIncomingDetail {
    @Resource
    private ServiceIncomingDetail serviceincomingDetail;

    @Operation(summary = "分页列表查询")
    @PostMapping("/page")
    public Result<Page<DtoIncomingDetail>> findPage(@RequestBody SearchReqIncomingDetail searchReqIncomingDetail) {
        return Result.success(serviceincomingDetail.findPageByParams(searchReqIncomingDetail));
    }

    @Operation(summary = "列表查询")
    @PostMapping("/list")
    public Result<List<DtoIncomingDetail>> list(@RequestBody SearchReqIncomingDetail searchReqIncomingDetail) {
        return Result.success(serviceincomingDetail.findListByParams(searchReqIncomingDetail));
    }


}
